<template>
  <el-card shadow="never" style="margin-bottom:20px;">
    <div slot="header" class="clearfix">
      <span>保密法制宣传教育专栏</span>
      <div style="float: right; padding: 3px 0" type="text">
        <a @click="showDetails">查看全部 &gt;</a>
      </div>
    </div>
    <el-table :show-header="false" :data="secrecyLegals" class="left_menu_side">
      <el-table-column prop="Bslp_Subject" :show-overflow-tooltip="true" label="标题">
        <template slot-scope="scope">
          <a @click="showSingle(scope.row)">{{scope.row.Bslp_Subject}}</a>
        </template>
      </el-table-column>
      <el-table-column prop="Bslpt_Name" label="类型" width="180" align="right"></el-table-column>
      <el-table-column prop="Bslp_PubDate" label="发布时间" width="180" align="right"></el-table-column>
    </el-table>
  </el-card>
</template>

<script type="text/javascript">
  import { ACCESS_TOKEN } from '@/store/mutation-types'
  import Vue from 'vue'
  import { openIFrame } from '@/utils/util'

  const baseUrl = process.env.VUE_APP_PORTAL_API
  const ticket = Vue.ls.get(ACCESS_TOKEN)

  export default {
    name: 'secret',
    data() {
      return {
        secrecyLegals: []
      }
    },
    mounted() {
      this.getAdminList()
    },
    methods: {
      showSingle(row) {
        let id = row.Bslp_Id
        let ReturnUrl = encodeURIComponent('/Modules/SecrecyLegalsystemPropaganda/SecrecyLegalsystemPropagandaView.aspx?BslpId='+id)
        let title = row.Bslp_Subject
        let url = baseUrl + '/login.xip?LoginMethod=portalletlogin&Userid=1&ReturnUrl=' + ReturnUrl
        openIFrame(id, '/secrecyLegals/' + id, title, url)
        this.$router.push({ name: id })
      },
      showDetails() {
        let ReturnUrl = encodeURIComponent('/SecrecyLegalsystemPropagandaList.xip#')
        let url = baseUrl + '/login.xip?LoginMethod=portalletlogin&Userid=1&ReturnUrl=' + ReturnUrl
        let title = '专栏列表'
        openIFrame('secrecyLegals', '/secrecyLegals', title, url)
        this.$router.push({ name: 'secrecyLegals' })
      },
      getAdminList() {
        let that = this
        let params = {
          serviceName: 'Xinfo.Bus.BL.Service.EgovPlatform.SHIJU.PortalLet.BMFZXCJYZLPortalLetService,Xinfo.Bus.BL.Service',
          getCount: false,
          guid: 'zwxx_bmfzxcjyzl',
          intTypeId: 0,
          strBizType: ''
        }
        this.getRequest('/PortalLet/GetPortalLetData', params).then(res => {
          that.secrecyLegals = res.data
        })
      }
    }
  }
</script>